﻿
<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/taglib.jsp"%>
<%@ taglib prefix="ec" uri="/WEB-INF/taglib/extremecomponents.tld" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>    
    <title>DataConverge</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="css/style.css">
	<link rel="stylesheet" type="text/css" href="css/extremecomponents.css">
	<SCRIPT type="text/javascript">
	 // var id="";
	  var page="";
	 /* function setSubjectId(id1){
	  	id=id1;
	  	//alert("subject id is "+id);
	  }*/
	  function del(id1){	  
	    if(window.confirm("确定删除此课题？","确定","取消")){	
	    	page=document.forms.ec.ec_p.value;
	  		document.location.href="subject.htm?action=delSubject&subjectId="+id1+"&page="+page;
	  	}
	  }
	  
	  function modify(id1){
	  	page=document.forms.ec.ec_p.value;
	  	document.location.href="subject.htm?action=gotoModifySubject&subjectId="+id1+"&page="+page;
	  }
	  
	  function showRelatedDocs(subjectId){
	    page=document.forms.ec.ec_p.value;
	  	document.location.href="subject.htm?action=showRelatedDocs&subjectId="+subjectId+"&page="+page;
	  }
	  
	  function showSubjectDetail(subjectId){
	  	page=document.forms.ec.ec_p.value;
	  	document.location.href="subjectModify.htm?subjectId="+subjectId+"&page="+page;
	  }
	</SCRIPT>
  </head>
  
  <body>
 <%@ include file="/WEB-INF/jsp/subject/menu.jsp"%>
     <ec:table 
  		items="subjectsInCharge"
  		var="subject"
  		action="${pageContext.request.contextPath}/subject.htm?action=listMySubjects"
  		imagePath="${pageContext.request.contextPath}/images/table/compact/*.gif"
  		title="负责课题列表"
  		view="compact"
  		rowsDisplayed="10">
  		<ec:exportXls
           fileName="output.xls" 
           tooltip="Export Excel"
           text="XLS"
        />
  		<ec:row highlightRow="true">    
  		<ec:column property="rowcount" cell="rowCount" sortable="false" width="10px" title="序号"/> 
  			<ec:column property="number" title="编号"/>        
            <ec:column property="state" title="状态">
              <c:choose>
              	<c:when test="${subject.state=='0'}">          		
            	 	<c:out value="申报中"/>           	
              	</c:when>
             	<c:when test="${subject.state=='1'}">
            	 	<c:out value="中标"/>     
             	</c:when>
              	<c:when test="${subject.state=='2'}">
            		<c:out value="在研"/>
             	</c:when>                      
 				<c:when test="${subject.state=='3'}">
            		<c:out value="申请结题"/>
            	</c:when>
            	<c:when test="${subject.state=='4'}">          		
            		<c:out value="已结题"/>
            	</c:when>
            	<c:when test="${subject.state=='5'}">
            		<c:out value="未中标"/>
            	</c:when>
            	<c:when test="${subject.state=='6'}">
            		<c:out value="推荐中标"/>
            	</c:when>
            	<c:otherwise>
            		<c:out value="未知"/>
            	</c:otherwise>
             </c:choose>
            </ec:column>           
   			<ec:column property="subjectName" title="名称">
   				<a href="#" onclick="showSubjectDetail('${subject.id}');"><c:out value="${subject.subjectName}"/></a>
   			</ec:column> 
   			<ec:column property="source" title="牵头单位">
   				<c:forEach items="${subject.orgs}" var="org">
   				   <c:out value="${org.name}"/>
   				</c:forEach>
   			</ec:column>
   			<ec:column property="source" title="课题来源">
   				<c:forEach items="${subject.tags}" var="tag">
   				   <c:out value="${tag.name}"/>
   				</c:forEach>
   			</ec:column>

   			<ec:column property="startDate" title="开始时间"/>
   			<!-- ec:column property="endDate" title="结束时间"/-->
            <ec:column property="modify" title="查看课题" filterable="false" sortable="false">
               <a href="#" onclick="showSubjectDetail('${subject.id}');"><img src="images/view.gif"/></a>
            </ec:column>
   			<ec:column property="relatedDocs" title="相关文档" filterable="false" sortable="false">
               <a href="#" onclick="showRelatedDocs('${subject.id}');"><img src="images/ftv2doc.gif"/></a>
            </ec:column>
            <ec:column property="modify" title="修改状态" filterable="false" sortable="false">
               <a href="#" onclick="modify('${subject.id}');"><img src="images/modify.gif"/></a>
            </ec:column>
            <ec:column property="delete" title="删除" filterable="false" sortable="false">
               <a href="#" onclick="del('${subject.id}');"><img src="images/delete.gif"/></a>
            </ec:column>
   		</ec:row>
	</ec:table>	
  </body>
</html>
